load("@rules_proto//proto:defs.bzl", "proto_library")
load("@io_bazel_rules_go//proto:def.bzl", "go_proto_library")
load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")

go_library(
    name = "baseccl",
    srcs = ["encryption_spec.go"],
    embed = [":baseccl_go_proto"],
    importpath = "github.com/cockroachdb/cockroach/pkg/ccl/baseccl",
    visibility = ["//visibility:public"],
    deps = [
        "//pkg/base",
        "//pkg/ccl/cliccl/cliflagsccl",
        "//pkg/util/protoutil",
        "@com_github_cockroachdb_errors//:errors",
        "@com_github_spf13_pflag//:pflag",
    ],
)

go_test(
    name = "baseccl_test",
    size = "small",
    srcs = ["encryption_spec_test.go"],
    embed = [":baseccl"],
    deps = ["//pkg/util/leaktest"],
)

proto_library(
    name = "baseccl_proto",
    srcs = ["encryption_options.proto"],
    strip_import_prefix = "/pkg",
    visibility = ["//visibility:public"],
)

go_proto_library(
    name = "baseccl_go_proto",
    compilers = ["//pkg/cmd/protoc-gen-gogoroach:protoc-gen-gogoroach_compiler"],
    importpath = "github.com/cockroachdb/cockroach/pkg/ccl/baseccl",
    proto = ":baseccl_proto",
    visibility = ["//visibility:public"],
)
